/**
 * 播放器方法V3
 * @param playerId:顶层容器ID
 * @param vid:vid
 * @param stopTime：停止的时间
 * @param stopFn：停止执行的方法
 */
var txPlayerV3 = function(playerId, vid, stopTime, stopFn) {
    var tencentPlayer = new Txplayer({
        containerId: playerId,
        vid: vid,
        width: '100%',
        height: '200',
        autoplay: true
    });
    var isShare = 0;//是否已经分享
    tencentPlayer.on("timeupdate", function(data) {
        //没有分享并且还没有超过时间
        if(!isShare && data.videoTag.currentTime >= stopTime) {
            this.pause();
            if(typeof (stopFn) !== 'function') {
                stopFn = function() {
                }
            }
            stopFn(isShare);
        }
    });
    this.share = function() {
        tencentPlayer.play();
        console.log(tencentPlayer);
        isShare = 1
    }
};